import sys
import pygame
from settings import Settings
from ship import Ship
import game_functions as gf


def run_game():

    # 初始化游戏并创建一个屏幕对象
    pygame.init()
    ai_settings = Settings()
    screen = pygame.display.set_mode((ai_settings.screen_width,ai_settings.screen_height))
    pygame.display.set_caption("Alien Invasion")
    ship = Ship(screen)
    bg_image = pygame.image.load('images/ship2.bmp').convert()



    # 开始游戏的主循环
    while True:

        # 检测是否推出
        gf.check_events()
        # 更新屏幕上的图像，并切换到新屏幕
        gf.update_screen(ai_settings,screen,ship)
        #123
        # 456751236



run_game()